var router = require('koa-router')();
const users=require('../models/users');
router.prefix('/users');

router.post('/login', function *(next) {
  const {login_name,password}=this.request.body;
  this.body = yield users.verifyUsers(login_name,password);
});

router.post('/register', function *(next) {
  const {login_name,password}=this.request.body;
  this.body = yield users.addUsers(login_name,password);
});

module.exports = router;
